package com.syx.rabbitmqspring.Listener;

import com.syx.rabbitmqspring.Constant.Constants;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class topicListener {
    @RabbitListener(queues = Constants.TOPIC_QUEUE1)
    public void queueListener1(Message message){

        System.out.println(Constants.TOPIC_QUEUE1+"listen1接收到消息"+message);


    }


    @RabbitListener(queues = Constants.TOPIC_QUEUE2)
    public void queueListener2(Message message){
        System.out.println(Constants.TOPIC_QUEUE2+"listen2接收到消息"+message);

    }



}
